//
// Maths.hpp for  in /home/goldbe_y//cpp/Maths/207correl
//
// Made by yoni goldberg
// Login   <goldbe_y@epitech.net>
//
// Started on  Mon May 16 19:07:12 2011 yoni goldberg
// Last update Sat May 28 16:53:12 2011 leo faucon
//
#ifndef __MATHS_H__
# define __MATHS_H__

#include <complex>
#include <vector>
#include <iostream>

#include "SDL.hpp"
#include "SDL_graph.hpp"

class Maths
{
public:
  Maths(std::vector<float> _X, std::vector<float> _Y, int _line, int opt);
  ~Maths() {};

  double		&getS() {return s;};
  double		&getA() {return a;};
  double		&getB() {return b;};
  double		&getR() {return r;};

  void			courbe(SDL_opt * win, double, double, double, double);
  void			axes_courbe(SDL_opt * win, SDL_graph * graph);

private:

  double		calc(double x, double, double);

  void			calcA();
  void			calcB();
  void			calcS();
  void			calcR();

  double		ecart(int);
  double		somme(int);

  int			line;
  double		a;
  double		b;
  double		s;
  double		r;
  std::vector<float>	Y;
  std::vector<float>	X;

  int			borne_x_a;
  int			borne_x_b;

  int			borne_y_a;
  int			borne_y_b;

  int			x_grad;
  int			y_grad;
};


#endif /* !__MATHS_H__ */
